home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
vol6n10d.arc
/
VOL6N10.DOC
< prev
Wrap
Text File
|
1987-05-17
|
11KB
|
293 lines
This DOCument file (written by a user, NOT by PC-Magazine) is designed to
provide only the most basic information about the superb menu programs
written by Robert L. Hummel, published in the 26 May 1987 issue of PC-
Magazine (Vol. 6, No. 10), and available in the file VOL6N10.ARC. For
detailed information and a step-by-step description of how each part of the
menu system works, please buy a copy of PC-Magazine.
NOTE: PC-Magazine programs are COPYRIGHT material and are made available by
PC-Magazine only for INDIVIDUAL, NONCOMMERCIAL use. PC-Magazine
allows copies to be made for others (including placement on
NONCOMMERCIAL electronic bulletin boards) AS LONG AS NO CHARGE IS
INVOLVED. However, making copies for ANY COMMERCIAL PURPOSE IS
STRICTLY PROHIBITED.
This file contains
l. a brief description of the files in VOL6N10.ARC
2. a brief introduction to the use of the menu system
3. basic information about designing customized menus
for use in the system
4. an example of one menu, with programming comments
1. Files in VOL6N10.ARC
DOS.BAR ready-to-run DOS menu compiled by MAKEBAR from DOS.BDF
DOS.BDF ASCII Bar-menu Definition File (basis of DOS.BAR)
MAKEBAR.ASM assembler listing of MAKEBAR.COM
MAKEBAR.BAS BASic program that creates MAKEBAR.COM
MAKEBAR.COM program that compiles (tokenizes) .BDF files into .BARs
SLASHBAR.ASM assembler listing of SLASHBAR.COM
SLASHBAR.BAS BASic program that creates SLASHBAR.COM
SLASHBAR.COM program that loads and executes .BAR files
2. Introduction to the use of the menu system
ASCII menuname.BDF file => MAKEBAR.COM == menuname.BAR file, then
SLASHBAR menuname.BAR (to make menu memory-resident), then
hotkey (to call up mem-res menu), then ESCape (to exit menu)
A. To run the DOS-menu already provided in VOL6N10.ARC, use
SLASHBAR DOS.BAR <enter>
This loads SLASHBAR and the DOS.BAR menu into memory. To activate
the menu after it's loaded, press Alt-Slash (Alt-/). Select choices
by moving the highlighted window or by typing the first character of
the option chosen. To back up through the menu levels and to exit,
use Esc.
B. To change the hotkey from Alt-Slash to another key combination, use
DEBUG SLASHBAR.COM
-E 167 SS (where SS is the scan code of the desired key)
-E 171 MM (where MM is the shift mask desired--
e.g., Alt=08, Ctrl=04, Left-Shift=02, Right-Shift=01)
-W
-Q
C. To run other menus, use
SLASHBAR [path]menuname.ext [/n]
where menuname.ext is the name of a .BAR file
and n is the number of bytes in the largest .BAR
file you intend to use before rebooting
To design other menus, see next section.
3. Designing customized menus
(Specific instructions on designing customized menus are beyond the
scope of this file. Please see PC-Magazine for detailed information
and explanation.)
SLASHBAR.COM loads, makes memory resident, and then processes menus
in.BAR files compiled by MAKEBAR.COM from .BDF files. The sample .BDF
file in section 4, below, uses familiar DOS commands, but any commands
accepted by any applications program (with a few very special
exceptions--see PC-Magazine) can be incorporated in a .BAR menu and
executed with just a keystroke.
The basic organization of a menu written in a .BDF file is
PROGRAM "string"
MENU name
EXECUTE name
MENU name
OPTION name, "string"
TYPE "string"
ASK "string"
INPUT
CR
MEND
END
The words in CAPITAL letters are BDF commands recognized by
MAKEBAR.COM, the compiler that processes .BDF files into .BAR files.
A name is a single word without spaces. A "string" is a series of
characters surrounded by quotation marks.
In addition to the commands and syntax indicated above, strings in
.BDF files can use special key names recognized by the MAKEBAR.COM
compiler. They are
{ESC} escape {F1}
{TAB} {F2}
{ENTER} {F3}
{BS} backspace {F4}
{HOME} {F5}
{PGUP} {F6}
{PGDN} {F7}
{END} {F8}
{U} up arrow {F9}
{D} down " {F10}
{L} left "
{R} right "
{INS}
{DEL}
{C} control
{S} shift
{A} alt
The use of this syntax is illustrated in the commented .BDF file that
follows (the MAKEBAR compiler program ignores semicolons and
everything following them on a line, so it's possible to comment .BDF
files in the same way that assembler listings are commented).
After the .BDF file is written, it must be compiled using MAKEBAR.COM
with the following command
MAKEBAR [path]input.bdf [path]output.bar
4. Commented examples of .BDF file
; Sample BDF file for some DOS commands
PROGRAM "DOS" ;each .BDF file MUST begin with PROGRAM "string"
MENU MAIN ;1st display runs from MENU to MEND
OPTION FILE,"FILE HANDLING FUNCTIONS" ;options are FILE DISK
EXECUTE FILE ; SYSTEM and CLS,
OPTION DISK,"DISK HANDLING FUNCTIONS" ;and "strings" appear as
EXECUTE DISK ;help-lines as each option
OPTION SYSTEM,"SYSTEM MAINTENANCE" ;is highlighted by user.
EXECUTE SYSTEM ;"Strings" here must be <78
OPTION CLS,"CLEAR THE SCREEN" ;chars. EXECUTE transfers
TYPE "CLS{ENTER}" ;control to another menu
MEND ;within same .BDF file.
;Note that CLS has no
MENU FILE ;EXECUTE because it can be
OPTION COPY,"COPY FILE(S)" ;run using the TYPE command.
TYPE "COPY " ;Here, note the space after
ASK "ENTER SOURCE FILE(S)" ;COPY; then user is ASKed to
INPUT ;INPUT the file(s) to COPY;
TYPE " " ;then a space is typed
ASK "COPY TO" ;automatically; user is asked
INPUT ;to INPUT destination; and a
CR ;CarriageReturn completes
OPTION DIR,"DIRECTORY OF FILES" ;the sequence.
TYPE "DIR "
ASK "WHAT DIRECTORY (ENTER = CURRENT)"
INPUT
CR
OPTION ERASE,"ERASE FILE(S)"
TYPE "ERASE "
ASK "ERASE WHAT FILE(S)"
INPUT
CR
OPTION RENAME,"RENAME FILE(S)"
TYPE "REN "
ASK "ENTER OLD FILE NAME"
INPUT
TYPE " "
ASK "ENTER NEW FILE NAME"
INPUT
CR
OPTION TYPE,"DISPLAY FILE(S)"
TYPE "TYPE "
ASK "DISPLAY WHAT FILE(S)"
INPUT
CR
MEND
MENU SYSTEM
OPTION DATE,"SET SYSTEM DATE"
TYPE "DATE "
ASK "ENTER DATE AS MM-DD-YY"
INPUT
CR
OPTION TIME,"SET SYSTEM TIME"
TYPE "TIME "
ASK "ENTER TIME AS HH:MM:SS"
INPUT
CR
OPTION PROMPT,"SET SYSTEM PROMPT"
TYPE "PROMPT "
ASK "ENTER NEW PROMPT"
INPUT
CR ;Note difference between
OPTION VER,"SHOW DOS VERSION" ;CR at end of option and
TYPE "VER{ENTER}" ;ENTER as part of string
MEND
MENU DISK
OPTION ASSIGN,"CHANGE DRIVE ASSIGNMENT"
TYPE "ASSIGN "
ASK "WHAT DRIVE LETTER IS REFERENCED"
INPUT
TYPE "="
ASK "WHAT DRIVE SHOULD BE SUBSTITUTED"
INPUT
CR
OPTION CHDIR,"CHANGE DIRECTORIES"
TYPE "CD " ;Note that menus can be
EXECUTE CHDIR ;nested using EXECUTE command
OPTION FORMAT,"FORMAT A DISK"
TYPE "FORMAT "
ASK "FORMAT WHICH DRIVE"
INPUT
CR
OPTION LABEL,"LABEL A DISK" ;Use of this option obviously
TYPE "LABEL " ;depends on DOS version used.
ASK "ENTER DRIVE TO LABEL"
INPUT
CR
ASK "ENTER NEW LABEL"
INPUT
CR
OPTION MKDIR,"CREATE A SUBDIRECTORY"
TYPE "MD "
ASK "ENTER NAME OF SUBDIRECTORY TO CREATE"
INPUT
CR
OPTION RMDIR,"REMOVE A SUBDIRECTORY"
TYPE "RD "
ASK "ENTER NAME OF SUBDIRECTORY TO REMOVE"
INPUT
CR
OPTION VOL,"DISPLAY DISK VOLUME LABEL"
TYPE "VOL "
ASK "SHOW VOLUME NAME OF WHICH DRIVE"
INPUT
CR
MEND
MENU CHDIR
OPTION PARENT,"CHANGE TO PARENT DIRECTORY"
TYPE "..{ENTER}"
OPTION ROOT,"CHANGE TO ROOT DIRECTORY"
TYPE "\{ENTER}"
OPTION OTHER,"SPECIFY SUBDIRECTORY"
ASK "ENTER SUBDIRECTORY"
INPUT
CR
MEND
END ;each .BDF file must end with END
-----
Unsolicited editorial from the author of this .DOC file:
These are examples of the outstanding programs published in every issue of
PC-Magazine. This magazine encourages some of the most practical and
elegant programming available. It provides detailed, clear explanations of
its programs and thereby helps readers who are not programmers to
understand how they work, how to modify them to suit their own
circumstances, and, cumulatively, how to become amateur programmers
themselves. The magazine also allows its programs to be copied and used
FOR NONCOMMERCIAL PURPOSES (see restrictions at the beginning of this .DOC
file) and makes them available free of charge on its own bulletin board,
PC-IRS (212-696-0360). If you like these programs, buy issues of the
magazine at newstands, or, to save a bundle, subscribe. (I have no
connection whatsoever with the magazine except as a subscriber, and I'm not
a programmer; I've learned almost everything I know about computers and
programs from reading PC-Magazine and Peter Norton's books.)